package py2

const pyCode = `
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import cStringIO
import time
import pycurl
import result

def fetch_get_state():
    url = "http://192.168.0.168:8888/hawkeye/channels/lantian/channel01/m3u8:360p"
    b = cStringIO.StringIO()
    buf = cStringIO.StringIO()
    c = pycurl.Curl()
    c.setopt(c.URL, url)
    c.setopt(c.WRITEFUNCTION, b.write)
    c.setopt(c.FOLLOWLOCATION, 1)
    c.setopt(c.MAXREDIRS, 5)
    c.setopt(c.HEADERFUNCTION, buf.write)
    c.setopt(c.OPT_FILETIME, 1)
    c.perform()
    result.bar(buf.getvalue(),str(c.getinfo(c.SPEED_DOWNLOAD)),str(c.getinfo(c.SIZE_DOWNLOAD)))
    c.close()
    b.close()
    buf.close()
	
	
fetch_get_state()
`